package com.tac.controller.wms;

import com.github.pagehelper.PageInfo;
import com.tac.common.result.Result;
import com.tac.pojo.wms.ReplenishmentApproval;
import com.tac.service.wms.ReplenishmentApprovalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@Api(tags = "智能仓储WMS--补货申请")
@RequestMapping("/replenishmentApproval")
@CrossOrigin
@RestController
public class ReplenishmentApprovalController {

    @Autowired
    private ReplenishmentApprovalService replenishmentApprovalService;


    //查看入库申请列表
    @ApiOperation("查看补货申请列表")
    @GetMapping("/getList")
    public Result<PageInfo<ReplenishmentApproval>> getList(Integer pageNum, Integer pageSize, String documentNumber, String applicant, Date applicationDateStart, Date applicationDateEnd, String applicationStatus, String reviewer,
                                                           Date reviewDateStart, Date reviewDateEnd, String reviewStatus){
        return replenishmentApprovalService.getList(pageNum,pageSize,documentNumber,applicant,applicationDateStart,applicationDateEnd,applicationStatus,reviewer,reviewDateStart,reviewDateEnd,reviewStatus);
    }

    //修改审核意见
    @ApiOperation("修改补货申请审核意见")
    @PutMapping("/update")
    public Result update(@RequestBody ReplenishmentApproval replenishmentApproval){
        return replenishmentApprovalService.update(replenishmentApproval);
    }

}
